package trade.cutil;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

public class RestHttpUtil {


    //用异常进行熔断处理
    public static String postHttp(RestTemplate restTemplate ,String url, String msg) {
        String response = "请求地址 -> " + url + "无效";
        try {
            response = restTemplate.getForObject(url, String.class, msg);
        } catch (Exception e) {
            return response;
        }
        return response;
    }
}
